using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using System.Data;
using XBLib.Dal.AdoDal;
using DataInfo;
using KenLib.Common;

namespace KenLib.Dal
{
    public class 語学力情報Dao : BaseAdoDao
      {
          private string m_requestTime;
          private string m_displayTime;
          public int Insert(語学力情報 obj)
          {
              int i = 0;
              try
              {
                  m_requestTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  DbParameter param20 = _daoHelper.CreateParameter("@廃止区分", obj.廃止区分, DbType.Int16);
                  DbParameter param1 = _daoHelper.CreateParameter("@語学コード", obj.語学コード, DbType.String);
                  DbParameter param2 = _daoHelper.CreateParameter("@語学名", obj.語学名, DbType.String);
                  DbParameter param3 = _daoHelper.CreateParameter("@レベル", obj.レベル, DbType.String);
                  DbParameter param4 = _daoHelper.CreateParameter("@検定種別コード", obj.検定種別コード, DbType.String);
                  DbParameter param5 = _daoHelper.CreateParameter("@検定種別", obj.検定種別, DbType.String);
                  DbParameter param6 = _daoHelper.CreateParameter("@検定受験日", obj.検定受験日, DbType.DateTime);
                  DbParameter param7 = _daoHelper.CreateParameter("@スコスListening", obj.スコスListening, DbType.Int32);
                  DbParameter param8 = _daoHelper.CreateParameter("@スコスWriting", obj.スコスWriting, DbType.Int32);
                  DbParameter param9 = _daoHelper.CreateParameter("@スコスReading", obj.スコスReading, DbType.Int32);
                  DbParameter param10 = _daoHelper.CreateParameter("@スコスTotal", obj.スコスTotal, DbType.Int32);
                  DbParameter param11 = _daoHelper.CreateParameter("@社員ID", obj.社員ID, DbType.Int32);
                  DbCommand command = _daoHelper.CreateCommand(CommandNameManager.Insert_HumanLangAbilityInfo, CommandType.StoredProcedure,param20, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
                  i = _daoHelper.Execute(command);
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteLog("", "", "INSERT", "Insert_HumanLangAbilityInfo", m_requestTime, m_displayTime);
              }
              catch (Exception ex)
              {
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteErr("", "", "SELECT", ex.Message, m_requestTime, m_displayTime);
              }
              return i;
          }

          public int Update(語学力情報 obj)
          {
              int i = 0;
              try
              {
                  m_requestTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  DbParameter param20 = _daoHelper.CreateParameter("@廃止区分", obj.廃止区分, DbType.Int16);
                  DbParameter param0 = _daoHelper.CreateParameter("@ID", obj.ID, DbType.Int32);
                  DbParameter param1 = _daoHelper.CreateParameter("@語学コード", obj.語学コード, DbType.String);
                  DbParameter param2 = _daoHelper.CreateParameter("@語学名", obj.語学名, DbType.String);
                  DbParameter param3 = _daoHelper.CreateParameter("@レベル", obj.レベル, DbType.String);
                  DbParameter param4 = _daoHelper.CreateParameter("@検定種別コード", obj.検定種別コード, DbType.String);
                  DbParameter param5 = _daoHelper.CreateParameter("@検定種別", obj.検定種別, DbType.String);
                  DbParameter param6 = _daoHelper.CreateParameter("@検定受験日", obj.検定受験日, DbType.DateTime);
                  DbParameter param7 = _daoHelper.CreateParameter("@スコスListening", obj.スコスListening, DbType.Int32);
                  DbParameter param8 = _daoHelper.CreateParameter("@スコスWriting", obj.スコスWriting, DbType.Int32);
                  DbParameter param9 = _daoHelper.CreateParameter("@スコスReading", obj.スコスReading, DbType.Int32);
                  DbParameter param10 = _daoHelper.CreateParameter("@スコスTotal", obj.スコスTotal, DbType.Int32);
                  DbParameter param11 = _daoHelper.CreateParameter("@社員ID", obj.社員ID, DbType.Int32);
                  DbCommand command = _daoHelper.CreateCommand(CommandNameManager.Update_HumanLangAbilityInfo, CommandType.StoredProcedure,param20, param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
                  i = _daoHelper.Execute(command);
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteLog("", "", "UPDATE", "Update_HumanLangAbilityInfo", m_requestTime, m_displayTime);
              }
              catch (Exception ex)
              {
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteErr("", "", "SELECT", ex.Message, m_requestTime, m_displayTime);
              }
              return i;
          }

          public int Delete(int id)
          {
              int i = 0;
              try
              {
                  m_requestTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  DbParameter param0 = _daoHelper.CreateParameter("@ID", id, DbType.Int32);

                  DbCommand command = _daoHelper.CreateCommand(CommandNameManager.Delete_HumanLangAbilityInfo, CommandType.StoredProcedure, param0);
                  i = _daoHelper.Execute(command);
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteLog("", "", "DELETE", "Delete_HumanLangAbilityInfo", m_requestTime, m_displayTime);
              }
              catch (Exception ex)
              {
                  m_displayTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
                  ExportFile.WriteErr("", "", "SELECT", ex.Message, m_requestTime, m_displayTime);
              }
              return i;
          }
          #region Mai
          public DataTable ShowGrid語学力情報(int 社員ID)
          {
              DbParameter param = _daoHelper.CreateParameter("@社員ID", 社員ID, DbType.Int32);
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_frmJ_TraineeLangAbilityInput_Select語学力情報_Mai", CommandType.StoredProcedure, param);
              return _daoHelper.Query(dbcommand);
          }

          public void Insert_frmJ_TraineeLangAbilityInput(語学力情報 oj)
            {
                  DbParameter param = _daoHelper.CreateParameter("@レベル", oj.レベル , DbType.String);
                  DbParameter param0 = _daoHelper.CreateParameter("@スコスListening", oj.スコスListening, DbType.Int32);
                  DbParameter param1 = _daoHelper.CreateParameter("@スコスWriting", oj.スコスWriting, DbType.Int32);
                  DbParameter param2 = _daoHelper.CreateParameter("@スコスReading", oj.スコスReading, DbType.Int32);
                  DbParameter param3 = _daoHelper.CreateParameter("@スコスTotal", oj.スコスTotal, DbType.Int32);
                  DbParameter param4 = _daoHelper.CreateParameter("@社員ID", oj.社員ID, DbType.Int32);
                  DbParameter param5 = _daoHelper.CreateParameter("@廃止区分", oj.廃止区分, DbType.Int16);
                  DbParameter param6 = _daoHelper.CreateParameter("@語学コード", oj.語学コード1, DbType.Int32);
                  DbParameter param7 = _daoHelper.CreateParameter("@検定種別コード", oj.検定種別コード1, DbType.Int32);
                  DbParameter param8 = _daoHelper.CreateParameter("@検定受験日", oj.検定受験日, DbType.DateTime);
                  DbParameter param9 = _daoHelper.CreateParameter("@語学名", oj.語学名, DbType.String);
                  DbParameter param10 = _daoHelper.CreateParameter("@検定種別", oj.検定種別, DbType.String);
                  DbCommand dbcommand = _daoHelper.CreateCommand("sp_frmJ_TraineeLangAbilityInput_Insert_Mai", CommandType.StoredProcedure, param, param0, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
                 _daoHelper.Query(dbcommand);
                
            }


          public void Update_frmJ_TraineeLangAbilityInput(語学力情報 ui)
          {
              DbParameter param = _daoHelper.CreateParameter("@レベル", ui.レベル, DbType.String);
              DbParameter param0 = _daoHelper.CreateParameter("@スコスListening", ui.スコスListening, DbType.Int32);
              DbParameter param1 = _daoHelper.CreateParameter("@スコスWriting", ui.スコスWriting, DbType.Int32);
              DbParameter param2 = _daoHelper.CreateParameter("@スコスReading", ui.スコスReading, DbType.Int32);
              DbParameter param3 = _daoHelper.CreateParameter("@スコスTotal", ui.スコスTotal, DbType.Int32);
              DbParameter param4 = _daoHelper.CreateParameter("@語学コード", ui.語学コード1, DbType.Int32);
              DbParameter param5 = _daoHelper.CreateParameter("@検定種別コード", ui.検定種別コード1, DbType.Int32);
              DbParameter param6 = _daoHelper.CreateParameter("@検定受験日", ui.検定受験日, DbType.DateTime);
              DbParameter param7 = _daoHelper.CreateParameter("@語学名", ui.語学名, DbType.String);
              DbParameter param8 = _daoHelper.CreateParameter("@検定種別", ui.検定種別, DbType.String);
              DbParameter param9 = _daoHelper.CreateParameter("@ID", ui.ID, DbType.Int32);
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_frmJ_TraineeLangAbilityInput_Update語学力情報_Mai", CommandType.StoredProcedure, param4, param, param5, param6, param0, param1, param2, param3, param7, param8, param9);
              _daoHelper.Query(dbcommand);

          }
          #endregion


          #region TUNG
          public void Insert_frmJ_StaffLangAbilityInput(語学力情報 obj)
          {
              DbParameter param1 = _daoHelper.CreateParameter("@廃止区分", obj.廃止区分, DbType.Int16);
              DbParameter param2 = _daoHelper.CreateParameter("@語学コード", obj.語学コード1, DbType.Int32);
              DbParameter param3 = _daoHelper.CreateParameter("@語学名", obj.語学名, DbType.String);
              DbParameter param4 = _daoHelper.CreateParameter("@レベル", obj.レベル, DbType.String);
              DbParameter param5 = _daoHelper.CreateParameter("@検定種別コード", obj.検定種別コード1, DbType.Int32);
              DbParameter param6 = _daoHelper.CreateParameter("@検定種別", obj.検定種別, DbType.String);
              DbParameter param7 = _daoHelper.CreateParameter("@検定受験日", obj.検定受験日, DbType.DateTime);
              DbParameter param8 = _daoHelper.CreateParameter("@スコスListening", obj.スコスListening, DbType.Int32);
              DbParameter param9 = _daoHelper.CreateParameter("@スコスWriting", obj.スコスWriting, DbType.Int32);
              DbParameter param10 = _daoHelper.CreateParameter("@スコスReading", obj.スコスReading, DbType.Int32);
              DbParameter param11 = _daoHelper.CreateParameter("@社員ID", obj.社員ID, DbType.Int32);
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_InsertfrmJ_StaffLangAbilityInput_TUNG", CommandType.StoredProcedure, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11);
              _daoHelper.Query(dbcommand);
          }

          public DataTable Select_frmJ_StaffLangAbilityInput(int ID)
          {
              DbParameter param1 = _daoHelper.CreateParameter("@ID", ID, DbType.Int32);
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_get_語学力情報_frmJ_StaffLangAbilityInput_TUNG", CommandType.StoredProcedure, param1);
              return _daoHelper.Query(dbcommand);

          }
          public void Update_frmJ_StaffLangAbilityInput(語学力情報 obj)
          {
              DbParameter param1 = _daoHelper.CreateParameter("@ID", obj.ID, DbType.Int32);
              DbParameter param2 = _daoHelper.CreateParameter("@語学コード", obj.語学コード1, DbType.Int32);
              DbParameter param3 = _daoHelper.CreateParameter("@語学名", obj.語学名, DbType.String);
              DbParameter param4 = _daoHelper.CreateParameter("@レベル", obj.レベル, DbType.String);
              DbParameter param5 = _daoHelper.CreateParameter("@検定種別コード", obj.検定種別コード1, DbType.Int32);
              DbParameter param6 = _daoHelper.CreateParameter("@検定種別", obj.検定種別コード, DbType.String);
              DbParameter param7 = _daoHelper.CreateParameter("@検定受験日", obj.検定受験日, DbType.DateTime);
              DbParameter param8 = _daoHelper.CreateParameter("@スコスListening", obj.スコスListening, DbType.Int32);
              DbParameter param9 = _daoHelper.CreateParameter("@スコスWriting", obj.スコスWriting, DbType.Int32);
              DbParameter param10 = _daoHelper.CreateParameter("@スコスReading", obj.スコスReading, DbType.Int32);
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_Update_frmJ_StaffLangAbilityInput_TUNG", CommandType.StoredProcedure, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10);
              _daoHelper.Query(dbcommand);

          }


          public DataTable Select_frmJ_StaffLangAbilityInput1()
          {
              DbCommand dbcommand = _daoHelper.CreateCommand("sp_get1_語学力情報_frmJ_StaffLangAbilityInput_TUNG", CommandType.StoredProcedure);
              return _daoHelper.Query(dbcommand);

          }

          #endregion
    
    
    
    }
     
        
}
